using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.Module_Type;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_Module_Type
    {
        public static DataTable SelectAll(int status)
        {
            try
            {
                BOModule_Type_Select_All action = new BOModule_Type_Select_All();
                usp_Module_Type_Select_All entity = new usp_Module_Type_Select_All();
                entity.STATUS = status;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status)
        {
            try
            {
                BOModule_Type_Select_Top action = new BOModule_Type_Select_Top();
                usp_Module_Type_Select_Top entity = new usp_Module_Type_Select_Top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable Search(int type_id)
        {
            try
            {
                BOModule_Type_Search action = new BOModule_Type_Search();
                usp_Module_Type_Search entity = new usp_Module_Type_Search();
                entity.TYPE_ID = type_id;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
        {
            try
            {
                BOModule_Type_Select_WithPaged action = new BOModule_Type_Select_WithPaged();
                usp_Module_Type_Select_WithPaged entity = new usp_Module_Type_Select_WithPaged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(string type_name, string type_description, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOModule_Type_Insert action = new BOModule_Type_Insert();
                usp_Module_Type_Insert entity = new usp_Module_Type_Insert();
                entity.TYPE_NAME = type_name;
                entity.TYPE_DESCRIPTION = type_description;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;
                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update(int type_id, string type_name, string type_description, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOModule_Type_Update action = new BOModule_Type_Update();
                usp_Module_Type_Update entity = new usp_Module_Type_Update();
                entity.TYPE_ID = type_id;
                entity.TYPE_NAME = type_name;
                entity.TYPE_DESCRIPTION = type_description;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;
                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int type_id)
        {
            try
            {
                BOModule_Type_Delete action = new BOModule_Type_Delete();
                usp_Module_Type_Delete entity = new usp_Module_Type_Delete();
                entity.TYPE_ID = type_id;
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Restore(int type_id)
        {
            try
            {
                BOModule_Type_Restore action = new BOModule_Type_Restore();
                usp_Module_Type_Restore entity = new usp_Module_Type_Restore();
                entity.TYPE_ID = type_id;
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

